package com.example.administrator.myapplication;

import android.annotation.SuppressLint;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Main3Activity extends AppCompatActivity {
private EditText ed_height,ed_weight,ed_result;
private Button btn_js,btn_gy,btn_tc;

    @SuppressLint("WrongViewCast")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ch2_bmi);
        ed_height=findViewById(R.id.ch2_bmi_ed_height);
        ed_weight=findViewById(R.id.ch2_bmi_ed_weight);
        btn_gy=findViewById(R.id.ch2_bmi_btn_computer);
        ed_result=findViewById(R.id.ch2_bmi_tv_result);
        View.OnClickListener click=new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               double sg=ed_height.getText().length();
               double tz=ed_weight.getText().length();
               ed_result.setText(sg*0.01*tz*sg*0.01);


            }
        };

        btn_js.setOnClickListener(click);




    }


}

